package object.obj2D.graphics;

import javax.microedition.khronos.opengles.GL10;

import object.obj2D.Object2D;
import system.Graphics;

public class Coordinate extends Object2D{
	public float dx = 1.0f, dy = 1.0f, dz = 1.0f;
	public Coordinate() {
		this.m_vertices = new float [] {
			0.0f,	0.0f,	0.0f,	//O
			dx,		0.0f,	0.0f,	//x
			0.0f,	dy,		0.0f,	//y
			0.0f,	0.0f,	dz		//z
		};
		this.m_indices = new short [] {
				0, 1,
				0, 2,	
				0, 3 
		};
		this.m_colors = new float [] {
				0f, 0f, 0f, 1f,
	            1f, 0f, 0f, 1f, 
	            0f, 1f, 0f, 1f, 
	            0f, 0f, 1f, 1f
		};
		this.Init();
	}

	public void Render() {
		Graphics.GetGraphics().glColorPointer(4, GL10.GL_FLOAT, 0, m_colorBuffer);
		Graphics.GetGraphics().glVertexPointer(3, GL10.GL_FLOAT, 0, m_vertexBuffer);
		Graphics.GetGraphics().glDrawElements(GL10.GL_LINES, m_indices.length, 
				GL10.GL_UNSIGNED_SHORT, m_indexBuffer);
	}
}
